import { loginChecking } from "@/utils/authUtils.js";

const needLogin = (meta = {}) => {
  return meta.needLogin;
};

export async function accessChecking(to) {
  let meta = to.meta;
  let isAccess = true;

  if (needLogin(meta)) {
    let isLogined = await loginChecking();
    isAccess = isLogined.value;
  }

  return isAccess;
}
